import { onMounted, reactive, toRef, toRefs } from "vue"
import { categories } from "@/apis/goods"
interface baseType {
    active: string | number,
    [prop: string]: any
}
export default function tabsHook() {

    const state = reactive<baseType>({
        active: 0,
        list: [],
    })

    onMounted(async () => {
        const {data} = await categories()
        state.list = data
    })




    return { ...toRefs(state) }
}
